package com.tao.controller;

import com.tao.entity.Category;
import com.tao.service.CategoryService;
import com.tao.vo.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author  诸葛先生
 * 功能：分类展示
 */
@RestController
public class CategoryController {

    @Autowired
    private CategoryService categoryService;

    @GetMapping("categoryList")
    public ResponseResult getCategories() {
//        return ResponseResult.okResult(categoryService.getCategoryList());
        List<Category> list = categoryService.getCategoryList();
        System.out.println(list);
        return ResponseResult.okResult(list);
    }
}
